<?php

namespace common\models;

/**
 * This is the ActiveQuery class for [[MktIndustry]].
 *
 * @see MktIndustry
 */
class MktIndustryQuery extends \yii\db\ActiveQuery
{
    use \common\wosotech\adjacencyList\AdjacencyListQueryTrait;
    
    /*public function active()
    {
        $this->andWhere('[[status]]=1');
        return $this;
    }*/

    /**
     * @inheritdoc
     * @return MktIndustry[]|array
     */
    public function all($db = null)
    {
        return parent::all($db);
    }

    /**
     * @inheritdoc
     * @return MktIndustry|array|null
     */
    public function one($db = null)
    {
        return parent::one($db);
    }

    public function children($parent_id = 0)
    {
        $this->andWhere(['parent_id' => $parent_id])->orderBy(['sort_order' => SORT_DESC]);
        return $this;
    }
    
}
